package com.yyk.yiliao.ui.activity.detail.activity;

import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment;

import com.yyk.yiliao.R;
import com.yyk.yiliao.base.BaseActivity;
import com.yyk.yiliao.adapter.CommonTabPagerAdapter;
import com.yyk.yiliao.ui.activity.detail.fragment.PleaceOrder_Fragment;
import com.yyk.yiliao.ui.activity.detail.fragment.PleaceOrder_Fragment2;
import com.yyk.yiliao.widget.NoSrcollViewPage;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 填写订单
 */

public class PlaceOrder_Activity extends BaseActivity {
    public static PlaceOrder_Activity intanse;
    @BindView(R.id.tabLayout)
    TabLayout tabLayout;
    @BindView(R.id.fragment)
    NoSrcollViewPage vp;

    @Override
    public int getLayoutId() {
        return R.layout.activity_placeorder;
    }

    @Override
    public void initView() {
        initToolbar();
        setTablyout();
    }

    private void initToolbar() {
        setBackArrow();
        setTitle("填写订单");
    }

    @Override
    public void initData() {
        initGetIntetnt();
        intanse = this;
    }


    private void setTablyout() {
        List<String> list = new ArrayList<>();
        list.add("快速送货");
        //        list.add("到店自取");
        CommonTabPagerAdapter adapter = new CommonTabPagerAdapter(getSupportFragmentManager(), list.size(), list, vp.getContext());
        adapter.setListener(new CommonTabPagerAdapter.TabPagerListener() {
            @Override
            public Fragment getFragment(int position) {
                if (position == 0) {
                    return PleaceOrder_Fragment.newInstance(position);
                } else {
                    return PleaceOrder_Fragment2.newInstance(position);
                }
            }
        });
        vp.setAdapter(adapter);
        tabLayout.setupWithViewPager(vp);

    }



    private void initGetIntetnt() {

    }


}
